home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / asmgloba.h < prev    next >
Encoding:
Text File  |  1993-07-16  |  848 b   |  45 lines

  1. ; global include file for all .s files to specify model and define macros
  2.     .MODEL USE16 LARGE,C
  3.     %MACS
  4.     .LALL
  5.  
  6.     if    @DataSize NE 0
  7.     LARGEDATA    EQU    1
  8.     endif
  9.  
  10. ; Push all general purpose registers. If 386/486, push 32-bit regs
  11. ; to support C code compiled with the -3 option
  12. PUSHALL    macro
  13.     if    @Cpu AND 8    ; PUSHAD available to protect 32-bit regs
  14.         pushad
  15.     elseif    @Cpu AND 4    ; PUSHA available
  16.         pusha
  17.     else
  18.         push    ax        ; save user regs on interrupt stack
  19.         push    bx
  20.         push    cx
  21.         push    dx
  22.         push    bp
  23.         push    si
  24.         push    di
  25.     endif
  26.     endm
  27.  
  28. ; Pop all general purpose registers
  29. POPALL    macro
  30.     if    @Cpu AND 8    ; PUSHAD available to protect 32-bit regs
  31.         popad
  32.         nop        ; Avoid bug on some early 386's
  33.     elseif    @Cpu AND 4    ; PUSHA available
  34.         popa
  35.     else
  36.         pop    di
  37.         pop    si
  38.         pop    bp
  39.         pop    dx
  40.         pop    cx
  41.         pop    bx
  42.         pop    ax
  43.     endif
  44.     endm
  45.